import time

import schedule

import accessibility_monitor
from config import Config
from email_notify import EmailNotifier


def start_monitors(cfg: Config, notifier: EmailNotifier):
    accessibility_monitor.start(cfg, notifier)


def main():
    cfg = Config()
    cfg.load()
    print(f'cfg: {cfg}')
    notifier = EmailNotifier(cfg)

    start_monitors(cfg, notifier)
    while True:
        schedule.run_pending()
        time.sleep(1)


if __name__ == '__main__':
    main()
